/**
 *
 */
package com.yidu.menuProject.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import com.yidu.menuProject.action.vo.FoodVo;
import com.yidu.menuProject.dao.FoodModelMapper;
import com.yidu.menuProject.model.FoodModel;
import com.yidu.menuProject.model.MealModel;

/**
 * @ author pengyong
 * @date 2018年7月13日 下午3:47:40
 * @ version 1.0
 */
@Service
public class FoodServiceImpl implements FoodService {
	@Resource
	private FoodModelMapper foodmodelmapper;
	/**
	 * 删除
	 */
	@Override
	public int deleteByPrimaryKey(FoodVo vo) {
		return foodmodelmapper.deleteByPrimaryKey(vo);
	}

	/**
	 * 增加
	 */
	@Override
	public int insert(FoodVo vo) {
		return foodmodelmapper.insert(vo);
	}

	
	@Override
	public int insertSelective(FoodModel record) {
		return foodmodelmapper.insertSelective(record);
	}

	
	@Override
	public FoodModel selectByPrimaryKey(String foodId) {
		return foodmodelmapper.selectByPrimaryKey(foodId);
	}

	@Override
	public int updateByPrimaryKeySelective(FoodModel record) {
		return foodmodelmapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(FoodModel record) {
		return foodmodelmapper.updateByPrimaryKey(record);
	}

	@Override
	public int selectcount(FoodVo vo) {
		return foodmodelmapper.selectcount(vo);
	}

	public List<FoodModel> selectfoodAll(String mealId,String foodName, FoodVo vo) {
		Map<String, Object> map = new HashMap<>();
		map.put("mealId", mealId);
		map.put("vo", vo);
		map.put("foodName", foodName);
		return foodmodelmapper.selectfoodAll(mealId,foodName,vo);
	}

	/* (non-Javadoc)
	 * @see com.yidu.menuProject.service.FoodService#deleteFood(com.yidu.menuProject.model.FoodModel)
	 */
	@Override
	public int deleteFood(FoodModel food) {
		// TODO Auto-generated method stub
		return foodmodelmapper.deleteFood(food);
	}
}
